package com.front.teacher.teacherapp.presenter;

import android.util.Log;

import com.front.teacher.teacherapp.base.BasePresenter;
import com.front.teacher.teacherapp.model.LoginModel;
import com.front.teacher.teacherapp.model.impl.OnLoginListener;
import com.front.teacher.teacherapp.view.impl.ILoginView;

/**
 * Created by Administrator on 2016/8/9.
 */
public class LoginPresenter extends BasePresenter<ILoginView> {
    private  ILoginView loginView;
    private LoginModel loginModel;

    public LoginPresenter(ILoginView loginView) {
        this.loginView = loginView;
        loginModel = new LoginModel();
    }

    public void login(String userName,String password){
        loginModel.getData(userName, password, new OnLoginListener() {
            @Override
            public void loginSuccess() {
                loginView.onSuccess();
            }

            @Override
            public void loginFail() {
                loginView.onFail();
            }
        });
    }
}
